 /**
 * @(#) StartupCommand.as
 *
 * @date		2009. 02. 25.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	Application 시작을 처리하는 Command
 * 				 
 */
package com.skt.common_hr.work_sac.controller
{
	import com.skt.common_hr.work_sac.model.CalendarProxy;
	import com.skt.common_hr.work_sac.model.DateRangeProxy;
	import com.skt.common_hr.work_sac.model.HolidayProxy;
	import com.skt.common_hr.work_sac.model.OverTimeSumProxy;
	import com.skt.common_hr.work_sac.model.ReqVacationProxy;
	import com.skt.common_hr.work_sac.model.ReqWorkTimeProxy;
	import com.skt.common_hr.work_sac.model.TeamVacationProxy;
	import com.skt.common_hr.work_sac.model.VacationApprovalProxy;
	import com.skt.common_hr.work_sac.model.VacationCodeProxy;
	import com.skt.common_hr.work_sac.model.VacationListProxy;
	import com.skt.common_hr.work_sac.model.VacationQuotaProxy;
	import com.skt.common_hr.work_sac.model.WorkTimeApprovalProxy;
	import com.skt.common_hr.work_sac.view.WorkTimeMediator;
	
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	public class StartupCommand extends SimpleCommand implements ICommand
	{
		
		override public function execute(note:INotification):void
		{
			var app:WorkSac = note.getBody() as WorkSac;
			trace("execute startupCommand in Work Module");
			
			facade.registerProxy(new CalendarProxy());
			facade.registerProxy(new VacationQuotaProxy());
			facade.registerProxy(new VacationCodeProxy());
			facade.registerProxy(new TeamVacationProxy());
			facade.registerProxy(new ReqWorkTimeProxy());
			facade.registerProxy(new ReqVacationProxy());
			facade.registerProxy(new DateRangeProxy());
			facade.registerProxy(new OverTimeSumProxy());
			facade.registerProxy(new WorkTimeApprovalProxy());
			facade.registerProxy(new VacationApprovalProxy());
			facade.registerProxy(new VacationListProxy());
			facade.registerProxy(new HolidayProxy());
			
			// MVC 모델중 View와 관련한 mediator들을 등록한다.
			facade.registerMediator(new WorkTimeMediator(app.view));
			
			loadHoliday();
		}
		
		private function loadHoliday():void {
			var proxy:HolidayProxy = facade.retrieveProxy(HolidayProxy.NAME) as HolidayProxy;
			proxy.load();
		}
	}
}